<?php
if ( !defined('IN_ADMINCP') || !defined('IN_SEC') ){
	exit('Access Denied.');
}

$act = $_G['gp_act'];

if ( $act == 'dialog' ){
	dialog('admin_setting_company');
}elseif( $act == 'add' ){
	$name = $_G['gp_name'] ? htmlspecialchars($_G['gp_name']) : jsonp('请填写公司名称');
	$parentid = abs(intval($_G['gp_parentid']));
	DB::Insert('company', array(
		'name' => $name,
		'parentid' => $parentid,
	));
	$admincp->success();
}

?>